home *** CD-ROM | disk | FTP | other *** search
- ; NetPar Client Installation Script
- ;
- ; NetPar Client © MikeySoft 1997-98 "When Mikey Goes Soft"
- ;
-
- (transcript "NetPar Installation")
-
- (set @default-dest "DEVS:")
- (set Action
- (askchoice
- (prompt "NetPar Client © MikeySoft 1997-98\n\"When Mikey Goes Soft\"\n\nWhat Action do you want to take?")
- (help @askchoice-help)
- (choices "Install" "Remove")
- (default 0)
- )
- )
-
- (debug "User Action" Action)
-
- ;
- ; Checking to See if NetPar Client has already been installed
- ;
- (set FinalAction 0)
- (set #OldPar "DEVS:orig_parallel.device")
- (if (exists #OldPar (noreq))
- (if (= Action 0)
- (set FinalAction 1)
- )
- )
-
- ; Debug or Not Debug
- (set Mode 0)
- (if (= Action 0)
- (set Mode
- (askchoice
- (prompt "What Mode do you want to install?\n\n"
- "Note: Debug Mode writes log files to SYS:NetParClient.log "
- "and SYS:NetParInit.log. This is much slower that the regular "
- "NetPar Client. Only use Debug Mode when trying to "
- "troubleshoot an unexpected problem.")
- (help @askchoice-help)
- (choices "Normal NetPar Client" "Debug NetPar Client")
- (default 0)
- )
- )
- )
-
- (if (= Action 0)
- (if (= Mode 0)
- (set #NewSource "NetPar.device")
- )
- )
- (if (= Action 0)
- (if (= Mode 1)
- (set #NewSource "NetParDebug.device")
- )
- )
-
- ; Start the install
- (if (= Action 0)
- ;Is it a New install?
- (if (= FinalAction 0)
- (if (not(exists #OldPar (noreq)))
- (run "rename devs:parallel.device devs:orig_parallel.device"
- (prompt "Renaming DEVS:Parallel.Device into DEVS:Orig_Parallel.Device. "
- "NetPar Client will replace your Original Parallel.device. If "
- "this step is skipped, the installation will not be completed."
- "\n\nNOTE: This Install Script comes with a \"Remove\" option which will "
- "restore your computer to it\'s original settings.")
- (help @run-help)
- (confirm)
- )
- )
- )
- )
-
-
- ; Copy the NetPar.Device
- (if (= Action 0)
- (if (exists #OldPar (noreq))
- ; Do the Actual Copy
- (copylib
- (prompt "Copying NetPar Client into DEVS:")
- (help @copylib-help)
- (source #NewSource)
- (dest "DEVS:")
- (newname "parallel.device")
- (confirm)
- )
- )
- )
-
- ; Finally the last user message
- (if (= Action 0)
- (if (exists #OldPar (noreq))
- (set HostName
- (askstring
- (prompt "What is the name of the host machine that you "
- "want to print to? The installer script will "
- "create a environment variable called PrintHOST "
- "to store this information. You can manually "
- "reset this variable later by using the setenv "
- "AmigaDOS command.")
- (help @askstring-help)
- )
- )
- )
- )
-
- ;Adding the PrintHOST
- (if (= Action 0)
- (if (exists #OldPar (noreq))
- (run "setenv PrintHOST" HostName
- (prompt "Making PrintHOST")
- )
- )
- )
-
- ; Saving PrinHost to ENVARC:
- (if (= Action 0)
- (if (exists "ENV:PrintHOST" (noreq))
- (run "copy ENV:PrintHOST ENVARC:PrintHOST"
- (prompt "Baking Up PrintHOST")
- )
- )
- )
-
- ;
- (if (= Action 0)
- (if (not (exists #OldPar (noreq)))
- (message "\nWas unable to rename current parallel.device to orig_parallel.device. "
- "Installation was NOT Complete!"
- (all)
- )
- )
- )
-
- ;
- ; Now to check on a removal
- (if (= Action 1)
- (if (exists #OldPar (noreq))
- (if (exists "DEVS:parallel.device" (noreq))
- (delete "DEVS:parallel.device"
- (prompt "Deleting old NetPar Client Installation")
- (optional "force")
- )
- )
- )
- )
-
- (if (= Action 1)
- (if (exists #OldPar (noreq))
- (rename #OldPar "DEVS:parallel.device"
- (prompt "Returning the original parallel.device")
- )
- )
- )
- (if (= Action 1)
- (if (exists "ENV:PrintHOST" (noreq))
- (delete "ENV:PrintHOST"
- (prompt "Removing PrintHOST")
- (optional "force")
- )
- )
- )
-
- (if (= Action 1)
- (if (exists "ENVARC:PrintHOST" (noreq))
- (delete "ENVARC:PrintHOST"
- (prompt "Removing PrintHOST")
- (optional "force")
- )
- )
- )
-
-